#ifndef SERVERWINDOW_H
#define SERVERWINDOW_H

#include <QMainWindow>
#include <QTcpServer>
#include<QTcpSocket>
#include<QFile>
#include<QThread>
QT_BEGIN_NAMESPACE
namespace Ui { class serverWindow; }
QT_END_NAMESPACE
class mythread;
class serverWindow : public QMainWindow
{
    Q_OBJECT

public:
    serverWindow(QWidget *parent = nullptr);
    ~serverWindow();

public slots:
    void showDateTime();

private slots:

    void connected();
    void getMessage();



private:
    Ui::serverWindow *ui;
    QTcpServer* server;
    QTcpSocket *socket;
    QFile *logFile;
    mythread *t1;
};


class mythread:public QThread
{
    Q_OBJECT
public:
    mythread(QWidget*parent=nullptr):QThread(parent)
    {
        setParent(parent);

    }
    ~mythread()
    {

    }

    void run() override
    {
        while (1) {

            emit updateTime();
             QThread::sleep(1);

        }
    }
 signals :

    void updateTime();
} ;

#endif // SERVERWINDOW_H
